//
//  UIImage+Circle.m
//  BuDeJie
//
//  Created by 梁梓烽 on 16/4/6.
//  Copyright © 2016年 liangzifeng. All rights reserved.
//

#import "UIImage+Circle.h"


@implementation UIImage (Circle)
-(UIImage *)circleImage{
    
    UIGraphicsBeginImageContext(self.size);
    
    UIBezierPath *path=[UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, self.size.width, self.size.height)];
    
    [path addClip];
    
    [self drawAtPoint:CGPointZero];

    UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return image;
}
@end
